<DOCFLEX_TEMPLATE VER='1.9'>
CREATED='2005-01-18 01:00:00'
LAST_UPDATE='2007-06-30 06:10:50'
DESIGNER_TOOL='DocFlex SDK 1.x'
EXECUTION_POLICY='free'
TEMPLATE_TYPE='DocumentTemplate'
DSM_TYPE_ID='xmldoc'
ROOT_ET='#DOCUMENT'
DESCR='Processes a single XML file'
<HTARGET>
	HKEYS={
		'contextElement.id';
		'"detail"';
	}
</HTARGET>
FMT={
	doc.lengthUnits='pt';
	doc.hlink.style.link='cs3';
}
<STYLES>
	CHAR_STYLE={
		style.name='Comment';
		style.id='cs1';
		text.font.name='Courier New';
		text.color.foreground='#666666';
	}
	CHAR_STYLE={
		style.name='Default Paragraph Font';
		style.id='cs2';
		style.default='true';
	}
	PAR_STYLE={
		style.name='File Info';
		style.id='s1';
		text.font.size='7';
		text.font.style.bold='true';
		par.border.top.style='solid';
		par.border.top.thickness='medium';
		par.margin.top='2';
		par.margin.bottom='12';
		par.padding.top='2';
	}
	PAR_STYLE={
		style.name='Heading 1';
		style.id='s2';
		text.font.name='Arial';
		text.font.size='16';
		text.font.style.bold='true';
		par.level='1';
		par.page.keepWithNext='true';
	}
	CHAR_STYLE={
		style.name='Hyperlink';
		style.id='cs3';
		text.decor.underline='true';
		text.color.foreground='#0000FF';
	}
	CHAR_STYLE={
		style.name='Internal Subset';
		style.id='cs4';
		text.font.name='Courier New';
		text.color.foreground='#0000FF';
	}
	CHAR_STYLE={
		style.name='Markup';
		style.id='cs5';
		text.color.foreground='#0000FF';
	}
	CHAR_STYLE={
		style.name='Name';
		style.id='cs6';
		text.color.foreground='#990000';
	}
	CHAR_STYLE={
		style.name='Name Highlight';
		style.id='cs7';
		text.color.foreground='#FF0000';
	}
	PAR_STYLE={
		style.name='Normal';
		style.id='s3';
		style.default='true';
	}
	CHAR_STYLE={
		style.name='Page header / footer';
		style.id='cs8';
		text.font.name='Arial';
		text.font.style.italic='true';
	}
	CHAR_STYLE={
		style.name='Value';
		style.id='cs9';
		text.font.size='7';
		text.font.style.bold='true';
	}
	CHAR_STYLE={
		style.name='Value Highlight';
		style.id='cs10';
		text.font.size='7';
		text.font.style.bold='true';
		text.color.foreground='#FF0000';
	}
	CHAR_STYLE={
		style.name='XML Source';
		style.id='cs11';
		text.font.name='Verdana';
		text.font.size='8';
	}
</STYLES>
<PAGE_FOOTER>
	<AREA_SEC>
		FMT={
			sec.outputStyle='table';
			text.style='cs8';
			table.sizing='Relative';
			table.cellpadding.horz='1';
			table.border.style='none';
			table.border.top.style='solid';
		}
		<AREA>
			<CTRL_GROUP>
				<CTRLS>
					<DATA_CTRL>
						FMT={
							ctrl.size.width='303';
							ctrl.size.height='39.8';
						}
						ATTR='xmlName'
					</DATA_CTRL>
					<PANEL>
						FMT={
							content.outputStyle='text-par';
							ctrl.size.width='196.5';
							ctrl.size.height='39.8';
							tcell.align.horz='Right';
							table.border.style='none';
						}
						<AREA>
							<CTRL_GROUP>
								<CTRLS>
									<LABEL>
										TEXT='Page'
									</LABEL>
									<DATA_CTRL>
										DOCFIELD='page'
									</DATA_CTRL>
									<LABEL>
										TEXT='of'
									</LABEL>
									<DATA_CTRL>
										DOCFIELD='num-pages'
									</DATA_CTRL>
								</CTRLS>
							</CTRL_GROUP>
						</AREA>
					</PANEL>
				</CTRLS>
			</CTRL_GROUP>
		</AREA>
	</AREA_SEC>
</PAGE_FOOTER>
<ROOT>
	<AREA_SEC>
		DESCR='XML\'s doc heading'
		<AREA>
			<CTRL_GROUP>
				FMT={
					par.style='s2';
				}
				<CTRLS>
					<DATA_CTRL>
						ATTR='xmlName'
					</DATA_CTRL>
				</CTRLS>
			</CTRL_GROUP>
			<CTRL_GROUP>
				FMT={
					par.style='s1';
					par.border.top.style='solid';
					par.border.top.thickness='medium';
				}
				<CTRLS>
					<DATA_CTRL>
						FORMULA='getAttrStringValue("xmlURI") + " -- " + dateTime()'
					</DATA_CTRL>
				</CTRLS>
			</CTRL_GROUP>
		</AREA>
	</AREA_SEC>
	<AREA_SEC>
		DESCR='XML declaration'
		COND='getAttrValue("xmlDecl") != ""'
		FMT={
			text.style='cs11';
		}
		<AREA>
			<CTRL_GROUP>
				FMT={
					txtfl.delimiter.type='none';
				}
				<CTRLS>
					<DATA_CTRL>
						FMT={
							text.style='cs5';
						}
						ATTR='xmlDecl'
					</DATA_CTRL>
				</CTRLS>
			</CTRL_GROUP>
		</AREA>
	</AREA_SEC>
	<ELEMENT_ITER>
		DESCR='iterates by all nodes in the XML'
		FMT={
			text.style='cs11';
		}
		TARGET_ET='<ANY>'
		SCOPE='simple-location-rules'
		RULES={
			'* -> *';
		}
		<BODY>
			<FOLDER>
				DESCR='processes <!DOCTYPE> node'
				MATCHING_ET='#DOCTYPE'
				<BODY>
					<AREA_SEC>
						DESCR='simple case of <!DOCTYPE> node'
						COND='getAttrStringValue("internalSubset") == ""'
						<AREA>
							<CTRL_GROUP>
								<CTRLS>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='<!DOCTYPE'
									</LABEL>
									<DATA_CTRL>
										FMT={
											text.style='cs5';
										}
										ATTR='name'
									</DATA_CTRL>
									<PANEL>
										COND='getAttrStringValue("publicId") != ""'
										FMT={
											ctrl.size.width='132.8';
											txtfl.delimiter.type='none';
										}
										<AREA>
											<CTRL_GROUP>
												<CTRLS>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='PUBLIC'
													</LABEL>
													<DELIMITER>
													</DELIMITER>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='"'
													</LABEL>
													<DATA_CTRL>
														FMT={
															ctrl.option.text.noBlankOutput='true';
															text.style='cs5';
														}
														ATTR='publicId'
													</DATA_CTRL>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='"'
													</LABEL>
												</CTRLS>
											</CTRL_GROUP>
										</AREA>
									</PANEL>
									<PANEL>
										COND='getAttrStringValue("systemId") != ""'
										FMT={
											ctrl.size.width='138';
											txtfl.delimiter.type='none';
										}
										<AREA>
											<CTRL_GROUP>
												<CTRLS>
													<LABEL>
														COND='getAttrStringValue("publicId") == ""'
														FMT={
															text.style='cs5';
														}
														TEXT='SYSTEM'
													</LABEL>
													<DELIMITER>
													</DELIMITER>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='"'
													</LABEL>
													<DATA_CTRL>
														FMT={
															ctrl.option.text.noBlankOutput='true';
															text.style='cs5';
														}
														ATTR='systemId'
													</DATA_CTRL>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='"'
													</LABEL>
												</CTRLS>
											</CTRL_GROUP>
										</AREA>
									</PANEL>
									<DELIMITER>
										FMT={
											text.style='cs5';
											txtfl.delimiter.type='none';
										}
									</DELIMITER>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='>'
									</LABEL>
								</CTRLS>
							</CTRL_GROUP>
						</AREA>
					</AREA_SEC>
					<AREA_SEC>
						DESCR='<!DOCTYPE> node with Internal Subset'
						COND='getAttrStringValue("internalSubset") != ""'
						<AREA>
							<CTRL_GROUP>
								<CTRLS>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='<!DOCTYPE'
									</LABEL>
									<DATA_CTRL>
										FMT={
											text.style='cs5';
										}
										ATTR='name'
									</DATA_CTRL>
									<PANEL>
										COND='getAttrStringValue("publicId") != ""'
										FMT={
											ctrl.size.width='132.8';
											txtfl.delimiter.type='none';
										}
										<AREA>
											<CTRL_GROUP>
												<CTRLS>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='PUBLIC'
													</LABEL>
													<DELIMITER>
													</DELIMITER>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='"'
													</LABEL>
													<DATA_CTRL>
														FMT={
															ctrl.option.text.noBlankOutput='true';
															text.style='cs5';
														}
														ATTR='publicId'
													</DATA_CTRL>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='"'
													</LABEL>
												</CTRLS>
											</CTRL_GROUP>
										</AREA>
									</PANEL>
									<PANEL>
										COND='getAttrStringValue("systemId") != ""'
										FMT={
											ctrl.size.width='138';
											txtfl.delimiter.type='none';
										}
										<AREA>
											<CTRL_GROUP>
												<CTRLS>
													<LABEL>
														COND='getAttrStringValue("publicId") == ""'
														FMT={
															text.style='cs5';
														}
														TEXT='SYSTEM'
													</LABEL>
													<DELIMITER>
													</DELIMITER>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='"'
													</LABEL>
													<DATA_CTRL>
														FMT={
															ctrl.option.text.noBlankOutput='true';
															text.style='cs5';
														}
														ATTR='systemId'
													</DATA_CTRL>
													<LABEL>
														FMT={
															text.style='cs5';
														}
														TEXT='"'
													</LABEL>
												</CTRLS>
											</CTRL_GROUP>
										</AREA>
									</PANEL>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='['
									</LABEL>
								</CTRLS>
							</CTRL_GROUP>
							<CTRL_GROUP>
								FMT={
									par.margin.left='10';
								}
								<CTRLS>
									<DATA_CTRL>
										FMT={
											ctrl.option.text.trimSpaces='true';
											text.style='cs4';
											text.option.renderNLs='true';
										}
										ATTR='internalSubset'
									</DATA_CTRL>
								</CTRLS>
							</CTRL_GROUP>
							<CTRL_GROUP>
								<CTRLS>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT=']>'
									</LABEL>
								</CTRLS>
							</CTRL_GROUP>
						</AREA>
					</AREA_SEC>
				</BODY>
			</FOLDER>
			<SS_CALL>
				DESCR='processes other XML nodes'
				COND='sectionBlock.execSecNone'
				SS_NAME='Node'
			</SS_CALL>
		</BODY>
	</ELEMENT_ITER>
	<TEMPLATE_CALL>
		DESCR='Bottom Message'
		COND='output.type == "document"'
		TEMPLATE_FILE='about.tpl'
	</TEMPLATE_CALL>
</ROOT>
<STOCK_SECTIONS>
	<ATTR_ITER>
		DESCR='generates list of the element\'s attributes'
		FMT={
			sec.outputStyle='text-par';
			txtfl.delimiter.type='none';
		}
		SCOPE='enumerated-attrs'
		EXCL_PASSED=false
		SS_NAME='AttrList'
		<BODY>
			<AREA_SEC>
				COND='name = iterator.attr.name;\nname.startsWith ("xml:") || name == "xmlns" ||\nname.startsWith ("xmlns:")'
				<AREA>
					<CTRL_GROUP>
						<CTRLS>
							<DELIMITER>
							</DELIMITER>
							<DATA_CTRL>
								FMT={
									text.style='cs7';
								}
								FORMULA='iterator.attr.name'
							</DATA_CTRL>
							<LABEL>
								FMT={
									text.style='cs5';
								}
								TEXT='="'
							</LABEL>
							<DATA_CTRL>
								FMT={
									text.style='cs10';
								}
								FORMULA='encodeXMLChars (\n  iterator.value.toString(),\n  true, true, true, false\n)'
							</DATA_CTRL>
							<LABEL>
								FMT={
									text.style='cs5';
								}
								TEXT='"'
							</LABEL>
						</CTRLS>
					</CTRL_GROUP>
				</AREA>
			</AREA_SEC>
			<AREA_SEC>
				COND='sectionBlock.execSecNone'
				<AREA>
					<CTRL_GROUP>
						<CTRLS>
							<DELIMITER>
							</DELIMITER>
							<DATA_CTRL>
								FMT={
									text.style='cs6';
								}
								FORMULA='iterator.attr.name'
							</DATA_CTRL>
							<LABEL>
								FMT={
									text.style='cs5';
								}
								TEXT='="'
							</LABEL>
							<DATA_CTRL>
								FMT={
									text.style='cs9';
								}
								FORMULA='encodeXMLChars (\n  iterator.value.toString(),\n  true, true, true, false\n)'
							</DATA_CTRL>
							<LABEL>
								FMT={
									text.style='cs5';
								}
								TEXT='"'
							</LABEL>
						</CTRLS>
					</CTRL_GROUP>
				</AREA>
			</AREA_SEC>
		</BODY>
	</ATTR_ITER>
	<FOLDER>
		DESCR='this stock-section processes a node which may contain similar nodes within itself'
		SS_NAME='Node'
		<BODY>
			<FOLDER>
				DESCR='the case of a non-element node'
				MATCHING_ETS={'#CDATA';'#COMMENT';'#NAMESPACE';'#PI';'#TEXT'}
				<BODY>
					<AREA_SEC>
						DESCR='TEXT node'
						MATCHING_ET='#TEXT'
						<AREA>
							<CTRL_GROUP>
								<CTRLS>
									<DATA_CTRL>
										FMT={
											ctrl.option.text.collapseSpaces='true';
											text.style='cs9';
											text.option.renderNLs='true';
										}
										FORMULA='encodeXMLChars (contextElement.value.toString())'
									</DATA_CTRL>
								</CTRLS>
							</CTRL_GROUP>
						</AREA>
					</AREA_SEC>
					<AREA_SEC>
						DESCR='CDATA node'
						MATCHING_ET='#CDATA'
						<AREA>
							<CTRL_GROUP>
								<CTRLS>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='<![CDATA['
									</LABEL>
								</CTRLS>
							</CTRL_GROUP>
							<CTRL_GROUP>
								FMT={
									par.margin.left='10';
								}
								<CTRLS>
									<DATA_CTRL>
										FMT={
											ctrl.option.text.collapseSpaces='true';
											text.style='cs9';
											text.option.renderNLs='true';
										}
										ELEMENT_VALUE
									</DATA_CTRL>
								</CTRLS>
							</CTRL_GROUP>
							<CTRL_GROUP>
								<CTRLS>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT=']]>'
									</LABEL>
								</CTRLS>
							</CTRL_GROUP>
						</AREA>
					</AREA_SEC>
					<AREA_SEC>
						DESCR='COMMENT node'
						MATCHING_ET='#COMMENT'
						<AREA>
							<CTRL_GROUP>
								FMT={
									txtfl.delimiter.type='none';
								}
								<CTRLS>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='<!--'
									</LABEL>
									<DATA_CTRL>
										FMT={
											text.style='cs1';
											text.option.renderNLs='true';
										}
										ELEMENT_VALUE
									</DATA_CTRL>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='-->'
									</LABEL>
								</CTRLS>
							</CTRL_GROUP>
						</AREA>
					</AREA_SEC>
					<AREA_SEC>
						DESCR='Processing Instruction node'
						MATCHING_ET='#PI'
						<AREA>
							<CTRL_GROUP>
								FMT={
									txtfl.delimiter.type='none';
								}
								<CTRLS>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='<?'
									</LABEL>
									<DATA_CTRL>
										FMT={
											text.style='cs5';
										}
										ATTR='target'
									</DATA_CTRL>
									<DELIMITER>
									</DELIMITER>
									<DATA_CTRL>
										FMT={
											text.style='cs5';
										}
										ELEMENT_VALUE
									</DATA_CTRL>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='?>'
									</LABEL>
								</CTRLS>
							</CTRL_GROUP>
						</AREA>
					</AREA_SEC>
				</BODY>
			</FOLDER>
			<FOLDER>
				DESCR='processes element node'
				COND='sectionBlock.execSecNone'
				<HTARGET>
					COND='hasChild("#NAMESPACE")'
					HKEYS={
						'contextElement.id';
						'"xmlns"';
					}
				</HTARGET>
				<BODY>
					<AREA_SEC>
						DESCR='this is executed only when the element contains a short text (in order to produce a single-line output)'
						COND='countChildren ("*") == 1 &&\n(text = getValueByLPath ("#TEXT")) != null && {\n  s = text.toString();\n  s.len() < 50 && ! s.contains ("\\n")\n}'
						<AREA>
							<CTRL_GROUP>
								FMT={
									txtfl.delimiter.type='none';
								}
								<CTRLS>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='<'
									</LABEL>
									<DATA_CTRL>
										FMT={
											text.style='cs6';
										}
										FORMULA='contextElement.name'
									</DATA_CTRL>
									<SS_CALL_CTRL>
										SS_NAME='AttrList'
									</SS_CALL_CTRL>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='>'
									</LABEL>
									<DATA_CTRL>
										FMT={
											ctrl.option.text.collapseSpaces='true';
											text.style='cs9';
										}
										FORMULA='encodeXMLChars (\n  getValueByLPath ("#TEXT").toString()\n)'
									</DATA_CTRL>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='</'
									</LABEL>
									<DATA_CTRL>
										FMT={
											text.style='cs6';
										}
										FORMULA='contextElement.name'
									</DATA_CTRL>
									<LABEL>
										FMT={
											text.style='cs5';
										}
										TEXT='>'
									</LABEL>
								</CTRLS>
							</CTRL_GROUP>
						</AREA>
					</AREA_SEC>
					<ELEMENT_ITER>
						DESCR='iterates by the element\'s child nodes -- the case of a complex element'
						COND='sectionBlock.execSecNone'
						TARGET_ET='<ANY>'
						SCOPE='simple-location-rules'
						RULES={
							'* -> *';
						}
						<BODY>
							<SS_CALL>
								DESCR='calls this stock-section recursively'
								FMT={
									sec.indent.left='10';
								}
								SS_NAME='Node'
							</SS_CALL>
						</BODY>
						<HEADER>
							<AREA_SEC>
								<AREA>
									<CTRL_GROUP>
										FMT={
											txtfl.delimiter.type='none';
										}
										<CTRLS>
											<LABEL>
												FMT={
													text.style='cs5';
												}
												TEXT='<'
											</LABEL>
											<DATA_CTRL>
												FMT={
													text.style='cs6';
												}
												FORMULA='contextElement.name'
											</DATA_CTRL>
											<SS_CALL_CTRL>
												SS_NAME='AttrList'
											</SS_CALL_CTRL>
											<LABEL>
												FMT={
													text.style='cs5';
												}
												TEXT='>'
											</LABEL>
										</CTRLS>
									</CTRL_GROUP>
								</AREA>
							</AREA_SEC>
						</HEADER>
						<FOOTER>
							<AREA_SEC>
								<AREA>
									<CTRL_GROUP>
										FMT={
											txtfl.delimiter.type='none';
										}
										<CTRLS>
											<LABEL>
												FMT={
													text.style='cs5';
												}
												TEXT='</'
											</LABEL>
											<DATA_CTRL>
												FMT={
													text.style='cs6';
												}
												FORMULA='contextElement.name'
											</DATA_CTRL>
											<LABEL>
												FMT={
													text.style='cs5';
												}
												TEXT='>'
											</LABEL>
										</CTRLS>
									</CTRL_GROUP>
								</AREA>
							</AREA_SEC>
						</FOOTER>
						<ELSE>
							DESCR='this is executed when no child nodes encountered -- the case of a simple element'
							<AREA_SEC>
								<AREA>
									<CTRL_GROUP>
										FMT={
											txtfl.delimiter.type='none';
										}
										<CTRLS>
											<LABEL>
												FMT={
													text.style='cs5';
												}
												TEXT='<'
											</LABEL>
											<DATA_CTRL>
												FMT={
													text.style='cs6';
												}
												FORMULA='contextElement.name'
											</DATA_CTRL>
											<SS_CALL_CTRL>
												SS_NAME='AttrList'
											</SS_CALL_CTRL>
											<LABEL>
												FMT={
													text.style='cs5';
												}
												TEXT='/>'
											</LABEL>
										</CTRLS>
									</CTRL_GROUP>
								</AREA>
							</AREA_SEC>
						</ELSE>
					</ELEMENT_ITER>
				</BODY>
			</FOLDER>
		</BODY>
	</FOLDER>
</STOCK_SECTIONS>
CHECKSUM='3xHD1sjbefW4lFSfdVt55A'
</DOCFLEX_TEMPLATE>